function addPhoneNumber() {
	var newContent = document.createElement("div");
	newContent.innerHTML = document.getElementById("phoneLine").innerHTML;
	document.getElementById("phones").appendChild(newContent);
}

function showDivSearch(name) {
	$(".searchMV").hide(500);
	$("#" + name).show(500);
}

function showDivResult(id) {
	$(".allResults").hide();
	$(".result" + id).show();
	$(".allPaginations").removeClass("active");
	$("#myPagination" + id).addClass("active");
	
}

function getAllContactsAjax()
{
	var serviceURL = './GetAllContacts.htm';
	$.ajax({
		type : "POST",
		url : serviceURL,
		data : param = "",
		dataType : "html",
		success : successFunc,
		error : errorFunc
	});

	function successFunc(data, status) {
		$("#myContactContent").hide();
		$("#myContactContent").html(data);
		$("#myContactContent").show(500);
	}

	function errorFunc() {
	}
}

function getAllAddressAjax()
{
	var serviceURL = './GetAllAddress.htm';
	$.ajax({
		type : "POST",
		url : serviceURL,
		data : param = "",
		dataType : "html",
		success : successFunc,
		error : errorFunc
	});

	function successFunc(data, status) {
		$("#myAddressContent").hide();
		$("#myAddressContent").html(data);
		$("#myAddressContent").show(500);
	}

	function errorFunc() {
	}
}

function addHideAddress()
{
	var div= $("#selectedAddressDiv");
	var result = $('input[name=existingAddress]:checked').val();
	div.html('<input type="hidden" name="selectedAddress" value="'+ result+ '" />');
	$("#selectedAddress").html();
	
	var resultSplited = result.split('~');
	document.getElementById("street").value = resultSplited[2];
	document.getElementById("city").value = resultSplited[3];
	document.getElementById("zip").value = resultSplited[4];
	document.getElementById("country").value = resultSplited[5];
}